﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

using Jzy.BLL.Project;
using Frame.Lib.Utilities;

namespace Jzy.Web.Project.Oversee
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class Delete : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string prjID = StrUtil.DecryptUrl(context.Request.QueryString["PrjID"]);
            string taskID = null;
            if (string.IsNullOrEmpty(context.Request.QueryString["TaskID"]))
            {
                taskID = StrUtil.DecryptUrl(context.Request.QueryString["TaskID"]);
            }
            string id = StrUtil.DecryptUrl(context.Request.QueryString["ID"]);

            TaskOverseeBO oversee = new TaskOverseeBO("");
            oversee.Delete(id);
            string url = "List.aspx?PrjID=" + StrUtil.EncryptUrl(prjID);
            if (taskID != null)
            {
                url += "&TaskID=" + taskID;
            }
            context.Response.Redirect(url);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
